package org.dlow.proxy;

import org.dlow.common.constants.RpcProxy;
import org.dlow.proxy.cglib.CgLibProxyProviderFactory;
import org.dlow.spi.ExtensionLoader;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @Author: 山沐与山
 * @CreateTime: 2024-05-10 19:26
 */
public class ProxyProviderFactory {



    public static ServiceProxyProvider get(RpcProxy rpcProxy){
        return ExtensionLoader.getInstance().get(rpcProxy.name);

    }

    public static ServiceProxyProvider get(String name){
        return ExtensionLoader.getInstance().get(name);

    }

    public static void init() throws IOException, ClassNotFoundException {
        ExtensionLoader.getInstance().loadExtension(ServiceProxyProvider.class);
    }
}
